<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Panier</title>
<link href="style.css" rel="stylesheet" type="text/css" />

</head>

<body>


<div class="center">
<div class="wrap header">
<!--ENTETE-->
	<hr/>
        <h1>PANIER</h1>
	  <h2>Auteur: Nguyen Tat Son Tung </h2>
      <hr/>
<!--FIN D'ENTETE-->
</div>
<div class="wrap main">
<div class="wrap main_r">
<div class="wrap main_content_max" id="main_content">
<div class="content">
<table class="blog" cellpadding="0" cellspacing="0">
<tr><td valign="top"><div>
		
<table class="contentpaneopen"><tr>
<td class="contentheading" width="100%"><img src="images/shopping-cart-accept.png">  PANIER </td></tr></table>
<table class="contentpaneopen"><tr><td valign="top" colspan="2">
 
       <?php 
		
		if (! isset($_COOKIE['selection'])) {
		
			echo  '<h2>Aucun film s&eacute;lectionn&eacute;</h2>' ;
			
			}
		else {
			include("Outils.inc");
			require("connect.php");

			$selection = $_COOKIE['selection'];
			$nbFilms = $selection[0];
			if ( $nbFilms == 0 ) echo '<h2>Le panier est vide</h2>';
			else {
				echo '<form action = "SuppSelection.php" method="post">
	<div class="jl_table">
  	<table cellpadding="3" cellspacing="0" border="1">
  	<tr class="sectiontableheader">
	<td colspan="2"><font size="2"> </font>
	<td><font size="2">NoFilm</font>
	<td><font size="2">Titre</font>
	</tr>';
				for ($i = 1; $i <= $nbFilms; $i++){
					$NoFilm = $selection[$i];
					$selectSQL = "SELECT Titre FROM films f WHERE NoFilm = '$NoFilm'";
					$donnees = DB_execSQL($selectSQL, $serv);
					$assoc = mysql_fetch_assoc($donnees);
					$titre = $assoc['Titre']; 
					
					echo "<tr><td><input type='checkbox' name='Case$i' /></td><TD align='center'><img src='images/Device_DVD_RW.png'></TD>
					<td><h2>Film $NoFilm</h2></td> 
					<td><h2>$titre<h2><input type='hidden' name='NoFilm$i' value='$NoFilm' /></td></tr>";
				
					
				}
					
					echo '</table></div>';
					
					
					
					echo '<table><tr><td><td><input type="image" src="images/shopping_cart_remove.png" title="Supprimer" /><br \><font size="2">Supprimer</font></form><br>';
					
					echo '<form method="POST" action="ViderSelection.php">';
					echo '<td><input name="ViderSelection" type="image" src="images/shopping_cart.png" title="Vider la s&eacute;lection" /><br \><font size="2">Vider le Panier</font>';
					echo '</form></tr></table>';
			}
		}
		
		
		

?>
</td></tr></table>

<span class="article_separator">&nbsp;</span>

</div></td></tr></table>
</div>
</div>

</body>
</html>